<?php
$translator = \Velacolib\Utility\Utility::translate();
if ($this->pageCount) {
   //echo '<pre>';
 // print_r($this->pagesInRange); die;
    ?>
    <!--
    <div class="span12">
        <div class="dataTables_info" id="DataTables_Table_0_info">Showing <?php //echo $this->getCurrentPageNumber() ?> to <?php echo 1; ?> of <?php //echo $this->pageCount ?> entries</div>
    </div>
    -->
    <div class="col-md-12 col-sm-12 col-lg-12 center">
        <div class="dataTables_paginate paging_bootstrap pagination">

            <ul class="pagination pagination-sm">
                <li class="prev"><a
                        href="<?php echo $this->url($this->route, $this->child_route); ?>?page=<?php echo $this->previous; ?><?php if (isset($this->search_val)) {
                            foreach ($this->search_val as $key => $val) {
                                echo '&' . $key . '=' . $val;
                            }

                        } ?>

                <?php if (isset($this->pen)) echo '&pen=' . $this->pen; ?>">← <?=$translator->translate('Previous')?></a></li>
                <?php foreach ($this->pagesInRange as $page): ?>
                    <?php if ($page != $this->current): ?>
                        <li>
                            <a href="<?php echo $this->url($this->route, $this->child_route); ?>?page=<?php echo $page; ?><?php if (isset($this->search_val)) {
                                foreach ($this->search_val as $key => $val) {
                                    echo '&' . $key . '=' . $val;
                                }
                            }?><?php if (isset($this->pen)) echo '&pen=' . $this->pen; ?>">
                                <?php echo $page; ?>
                            </a>
                        </li>
                    <?php else: ?>
                        <li class="active">
                            <a href="#"><?php echo $page; ?></a>
                        </li>
                    <?php endif; ?>
                <?php endforeach; ?>
                <li class="next"><a
                        href="<?php echo $this->url($this->route, $this->child_route); ?>?page=<?php echo $this->next; ?><?php if (isset($this->search_val)) {
                            foreach ($this->search_val as $key => $val) {
                                echo '&' . $key . '=' . $val;
                            }
                        } ?><?php if (isset($this->pen)) echo '&pen=' . $this->pen; ?>"><?=$translator->translate('Next')?> → </a></li>
            </ul>
        </div>
    </div>
    </div>
<?php
}
?>